﻿<Page
    x:Class="wToggl.LoginPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:wToggl"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Loaded="LoginPage_OnLoaded"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" d:DataContext="{d:DesignInstance local:LoginPage}">
    <Grid x:Name="LayoutRoot">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <local:BackgroundWorkOverlay Canvas.ZIndex="10" Grid.RowSpan="2" IsVisible="{Binding IsLogginIn}" OverlayMessage="Contacting Toggl..."/>

        <!-- Title Panel -->
        <StackPanel Grid.Row="0" Margin="19,0,0,0">
            <TextBlock Text="Toggly" Style="{ThemeResource TitleTextBlockStyle}" Margin="0,12,0,0"/>
            <TextBlock Text="login" Margin="0,-6.5,0,26.5" Style="{ThemeResource HeaderTextBlockStyle}" CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}"/>
        </StackPanel>

        <Grid Canvas.ZIndex="0" Grid.Row="1" x:Name="ContentRoot" Margin="19,9.5,19,0">
            <StackPanel Orientation="Vertical">

                <TextBlock Style="{StaticResource BodyTextBlockStyle}" TextWrapping="WrapWholeWords" TextAlignment="Justify">
                    Welcome to Toggly, a Toggl client for your Windows Phone!
                </TextBlock>

                <Button Style="{StaticResource PrimaryButton}" Name="StandardLoginButton" Margin="4,20" HorizontalAlignment="Stretch" Click="StandardLoginButton_Click">
                    <TextBlock Style="{StaticResource PrimaryButtonText}">Login using email/password</TextBlock>
                </Button>
                <Button Style="{StaticResource SecondaryButton}" Name="TokenLoginButton" HorizontalAlignment="Stretch" Click="TokenLoginButton_Click">
                    <TextBlock Style="{StaticResource SecondaryButtonText}">Login using API token</TextBlock>
                </Button>
            </StackPanel>
        </Grid>
    </Grid>
</Page>
